package com.youedata.modular.enums;

public enum SchoolFinishedFlag {
    /**
     * 学历状态枚举
     */
    BK_ING("00", "本科在读"),
    BK_END("01", "本科已毕业"),
    ZK_ING("02", "专科在读"),
    ZK_END("03", "专科已毕业");

    private String code;
    private String desc;

    SchoolFinishedFlag(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static SchoolFinishedFlag getByCode(String code) {
        SchoolFinishedFlag[] values = values();
        for (SchoolFinishedFlag sw : values) {
            if (sw.code.equals(code)) {
                return sw;
            }
        }
        return null;
    }

    public static SchoolFinishedFlag getByDesc(String desc) {
        SchoolFinishedFlag[] values = values();
        for (SchoolFinishedFlag sw : values) {
            if (sw.desc.equals(desc)) {
                return sw;
            }
        }
        return null;
    }

    public static Boolean checkCode(String code) {
        SchoolFinishedFlag[] values = values();
        for (SchoolFinishedFlag sw : values) {
            if (sw.code.equals(code)) {
                return true;
            }
        }
        return false;
    }


    public static Boolean checkDesc(String desc) {
        SchoolFinishedFlag[] values = values();
        for (SchoolFinishedFlag sw : values) {
            if (sw.desc.equals(desc)) {
                return true;
            }
        }
        return false;
    }
}
